package com.example.controller;

import com.example.entity.supervision.PlanDictItem;
import com.example.service.PlanDictItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * Created by simon on 2018/8/7.
 * 本次计划的检查项目
 */
@RestController
@RequestMapping("api/planDictItem")
public class PlanDictItemController {

    @Autowired
    PlanDictItemService planDictItemService;

    /**
     * 新增 检查项目
     * @param map
     * @return
     */
    @RequestMapping(value = "/addPlanDictItem", method = RequestMethod.POST)
    Map<String, Object> add(@RequestBody Map<String, List<PlanDictItem>> map) {
        return planDictItemService.add(map);

    }

    /**
     *  查询 检查项目
     * @param map
     * @return
     */
    @RequestMapping(value = "/queryPlanDictItem", method = RequestMethod.POST)
    Map<String, Object> query(@RequestBody Map map) {
        return planDictItemService.query(map);
    }

    /**
     *  查询 检查项目 直接返回所有检查项
     * @param map
     * @return
     */
    @RequestMapping(value = "/queryPlanDictItem1", method = RequestMethod.POST)
    Map<String, Object> queryPlanDictItem(@RequestBody Map map) {
        return planDictItemService.queryPlanDictItem(map);
    }

}
